package Learn2;

import java.util.ArrayList;
import java.util.List;

public class TestList {

	    public static void main(String[] args) {
	        List<String> list = new ArrayList<>();
	        list.add("apple"); // size=1
	        list.add(null); // size=2
	        list.add("pear"); // size=3
	        list.add("apple");//size=4
	        String second = list.get(1); // null
	        System.out.println(second);
	    }
	    
	    public class setList{
	    	List<String> list1 = new ArrayList<>();
	    	List<String> list2 = List.of("a","b","c");
	    	
	    }
	    
	    public class Test1{
	        List<String> list = List.of("apple", "pear", "banana");
	        for (int i=0; i<list.size(); i++) {
	            String s = list.get(i);
	            System.out.println(s);
	        }
	    }
	    
	    
	    
}
	
	
	

